package no.eirikb.bomberman.client;

import java.rmi.Remote;
import java.rmi.RemoteException;
import no.eirikb.bomberman.shared.Game;
import no.eirikb.bomberman.applet.game.Pos;
import no.eirikb.bomberman.applet.game.Way;
import no.eirikb.bomberman.shared.clientcommand.ClientEvent;
import no.eirikb.bomberman.shared.message.Message;

/**
 *
 * @author eirikb
 */
public interface Client extends Remote {

    /**
     * Used to test if client is still alive
     * @throws java.rmi.RemoteException
     */
    void ping() throws RemoteException;

    /**
     * Recieve a chat-message
     * @param message Message to be displayed
     * @throws java.rmi.RemoteException
     */
    void chat(Message message) throws RemoteException;

    /**
     * Add a game to the list of games
     * @param game Game to be added
     * @throws java.rmi.RemoteException
     */
    void addGame(Game game) throws RemoteException;

    /**
     * Remove a game from the list of games
     * @param game Game to add to the list
     * @throws java.rmi.RemoteException
     */
    void removeGame(Game game) throws RemoteException;

    /**
     * Update a game already in the list of games
     * @param game Game to updates
     * @throws java.rmi.RemoteException
     */
    void updateGame(Game game) throws RemoteException;

    /**
     * Start game
     * @param game Make sure all have the same game
     * @throws java.rmi.RemoteException
     */
    void startGame(Game game) throws RemoteException;

    /**
     * Send a ClientEvent to the client
     * @param event The event
     * @throws java.rmi.RemoteException
     */
    void clientEvent(ClientEvent event) throws RemoteException;
}
